/*
 * Class name: 			GroupRequest
 * Class description: 	The GroupRequest class is the means for which
 * 						one user can invite another to groups. This class
 * 						addresses the need to only have desired group members
 * Project:				GrocerWE
 */

package com.cse210.grocerwe.common;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

@PersistenceCapable(detachable="true")
public class GroupRequest{
	
	//database primary key
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
    
    //user to be invited 
    @Persistent
    private String user;
    
    //owner/creator of group
    @Persistent
    private String owner;
    
    //name of the group for easy display
    @Persistent
    private String groupname;
    
    //foreign key of group
    @Persistent
    private String group;
    
    /*
     * Constructor
     */
    public GroupRequest(String user,String owner, String groupname, String group)
    {
    	this.user = user;
    	this.owner = owner;
    	this.groupname = groupname;
    	this.group = group;
    }
    
    /*
     * Getters
     */
    public String getKey()
    {
    	return KeyFactory.keyToString(key);
    }
    public String getUser()
    {
    	return user;
    }
    public String getOwner()
    {
    	return owner;
    }
    public String getGroupName()
    {
    	return groupname;
    }
    public String getGroup()
    {
    	return group;
    }

}
